#pragma once
#include <string>

#ifdef ADVANCED_LANG
#define CONVERT(x) TOB::UTF8Encoding::convert(x)
#else
#define CONVERT(x) (x)
#endif

#define MASKBITS    0x3F
#define MASKBYTE    0x80
#define MASK2BYTES  0xC0
#define MASK3BYTES  0xE0
#define MASK4BYTES  0xF0
#define MASK5BYTES  0xF8
#define MASK6BYTES  0xFC

namespace TOB {
  class UTF8Encoding {
   public:
    static std::wstring convert(std::string &in);
    static std::string convert(std::wstring &in);

   protected:
    static std::wstring convert2(std::string &in);
    static std::wstring convert4(std::string &in);
    static std::string convert2(std::wstring &in);
    static std::string convert4(std::wstring &in);
  };
}
